{% extends "base.html" %}
{% block header %}
<link rel="stylesheet" type="text/css" href="/media/css/forms.css">
<script type="text/javascript" src="/static/js/jquery.treeview.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(".tabs > ul").tabs();
    $("#browser").treeview({
        collapsed:true,
        unique: true,
        persist: "cookie",
		toggle: function() {
			console.log("%s was toggled.", $(this).find(">span").text());
		}
	});

});
</script>
{% endblock %}

{% block menu %}
<ul class="box">
	<li><a href="/index"><span>首页</span></a></li>
	<!-- Active -->
	<li><a href="/monitor"><span>服务监控</span></a></li>
	<li><a href="/report"><span>服务报表</span></a></li>
	<li><a href="/alert"><span>报警管理</span></a></li>
	<li><a href="/flow"><span>流程管理</span></a></li>
	<li  id="menu-active"><a href="/doc"><span>运维文档</span></a></li>
	<li><a href="/host"><span>服务主机</span></a></li>
	<li><a href="/accident"><span>事故中心</span></a></li>
</ul>
{% endblock %}

{% block aside %}
<div class='left-col'>
{% autoescape off %}
    {{ tree }}
{% endautoescape %}
</div>
{% endblock %}
{% block content %}
        <div id="mon-tit">
            <div class="left">文档管理 >> 文档列表</div>
            <div class="right"><a href="/doc/adddoc/">添加文档</a></div>
        </div>
        <div class="clr"></div>
        <hr />
        <h3  class='tit'>文档列表</h3>
        <div  class="flow-dis right-col">
            <div class="title">
                <span style="width:10%">状态</span>
                <span style="width:25%">文档名称</span>
                <span style="width:25%">对应产品线名称</span>
                <span style="width:10%">创建者</span>
                <span style="width:15%">创建时间</span>
                <span style="width:10%">操作</span>
            </div>
          {% for d in  docs %}
            <div class="{% cycle 'ji' 'ou' %}">
                <span style="width:10%">{%ifequal d.status "1" %}通过{% else %}未通过{% endifequal %}</span>
                <span style="width:25%">{{ d.name }}</span>
                <span style="width:25%">{{ d.pid }}</span>
                <span style="width:10%">{{ d.uid }}</span>
                <span style="width:15%">{{ d.timestamp|date:"Y-m-d" }}</span>
                <span style="width:10%"><a href="/doc/show/{{d.id}}">查看</a>|
                {% if d.uid == username %}
                <a href="/doc/edit/{{d.id}}">编辑</a>
                {% else %}编辑{% endif%}
                </span>
            </div>
        {% endfor %}
        </div>

        <hr/>
   <!--
   <form action="" method="post" enctype="multipart/form-data">
        <div class="module aligned formview">
            <div class="form-row">
                <label for="detail"  >添加文档：</label>
                <input type="file" name="file" />
                <input type="submit" value="上传"  style="margin-right:40px;width:80px" />
            </div>
   		</div>
    </form>
    -->
   </table>
</div>
 
{% endblock %}

